import request from '@/utils/request'

// 查询合同模板列表
export function contractTemplateList(query) {
  return request({
    url: '/contractTemplate/contractTemplateOther/list',
    method: 'get',
    params: query
  })
}

// 获取其他合同模板详细信息
export function contractTemplateDetails(id) {
    return request({
        url: `/contractTemplate/contractTemplateOther/${id}`,
        method: 'get'
    })
}

// 查询其他合同模板参数
export function contractTemplateParam(id) {
    return request({
        url: `/contractTemplate/contractTemplateParam/otherList`,
        method: 'get'
    })
}

// 保存
export function contractTemplateAdd(data) {
  return request({
    url: '/contractTemplate/contractTemplateOther',
    method: 'post',
    data:data
  })
}

// 编辑
export function contractTemplateUpdate(data) {
  return request({
    url: '/contractTemplate/contractTemplateOther',
    method: 'put',
    data:data
  })
}

// 保存and提交审批
export function submitForApproval(data) {
  return request({
    url: '/contractTemplate/contractTemplateOther/submitForApproval',
    method: 'post',
    data:data
  })
}

// 列表发起审批
export function initiateApproval(id) {
    return request({
        url: `/contractTemplate/contractTemplateOther/initiateApproval/${id}`,
        method: 'post'
    })
}

//启用前校验
export function enableVerify(id) {
    return request({
        url: `/contractTemplate/contractTemplateOther/enableVerify/${id}`,
        method: 'put'
    })
}


//启用
export function contractTemplateEnable(id) {
    return request({
        url: `/contractTemplate/contractTemplateOther/confirmEnable/${id}`,
        method: 'put'
    })
}

//禁用
export function contractTemplateDisable(ids) {
    return request({
        url: `/contractTemplate/contractTemplateOther/disable/${ids}`,
        method: 'put'
    })
}

// 审批记录
export function getFlowRecord(id) {
  return request({
    url: `/contractTemplate/contractTemplateOther/getFlowRecord/${id}`,
    method: 'get'
  })
}

// 作废
export function contractTemplateDelete(ids) {
  return request({
    url: `/contractTemplate/contractTemplateOther/${ids}`,
    method: 'delete'
  })
}

//管理客户
export function contractTemplateOtherManageCustomers(data) {
    return request({
        url: '/contractTemplate/contractTemplateOther/manageCustomers',
        method: 'post',
        data:data
    })
}

// 审批记录
export function contractTemplateGetFlowRecord(id) {
    return request({
        url: `/contractTemplate/contractTemplateOther/getFlowRecord/${id}`,
        method: 'get'
    })
}

// 操作记录
export function contractTemplateLog(id) {
    return request({
        url: `/contractTemplate/contractTemplateOther/log/${id}`,
        method: 'get'
    })
}

// 选择额度申请 列表
export function selectQuotaApplication(query) {
    return request({
        url: '/creditReview/limit/selectQuotaApplication',
        method: 'get',
        params: query
    })
}

// 选择额度申请 详情
export function selectQuotaApplicationDetails(calcSchemeCode) {
    return request({
        url: `/creditReview/limit/selectQuotaApplicationDetails/${calcSchemeCode}`,
        method: 'get'
    })
}
